package r21310.chap04.d1002;

import java.util.Random;
import java.util.Scanner;

    public class youxi {
        public youxi() {
        }

        public static void main(String[] args) {
            int ff = 0;
            int gg = 0;
            Scanner h = new Scanner(System.in);

            for(int i = 0; i < 5; ++i) {
                Random random = new Random();
                int n = random.nextInt(3) + 1;
                String nn = null;
                switch(n) {
                    case 1:
                        nn = "石头";
                        break;
                    case 2:
                        nn = "剪刀";
                        break;
                    case 3:
                        nn = "布";
                }

                int g = i + 1;
                System.out.println("第" + g + "局请出拳");
                String q = h.next();
                int p = 0;
                byte var12 = -1;
                switch(q.hashCode()) {
                    case 24067:
                        if (q.equals("布")) {
                            var12 = 2;
                        }
                        break;
                    case 675030:
                        if (q.equals("剪刀")) {
                            var12 = 1;
                        }
                        break;
                    case 974753:
                        if (q.equals("石头")) {
                            var12 = 0;
                        }
                }

                switch(var12) {
                    case 0:
                        p = 1;
                        break;
                    case 1:
                        p = 2;
                        break;
                    case 2:
                        p = 3;
                }

                if (p - n == 0) {
                    System.out.println("平局。电脑出的是--" + nn);
                } else if (p - n == 1 | p - n == -2) {
                    System.out.println("你输了。电脑出的是--" + nn);
                    ++ff;
                } else {
                    System.out.println("你赢了。电脑出的是--" + nn);
                    ++gg;
                }
            }

            System.out.println("本局游戏中你赢了" + gg + "局，平了" + (5 - gg - ff) + "局");
            if (ff == gg) {
                System.out.println("平局");
            } else if (ff < gg) {
                System.out.println("你赢了");
            } else {
                System.out.println("你输了");
            }

        }
    }


